package cn.com.code.hwjs;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * https://www.nowcoder.com/practice/e896d0f82f1246a3aa7b232ce38029d4?tpId=37&tqId=21282&rp=1&ru=/exam/oj&qru=/exam/oj&sourceUrl=%2Fexam%2Foj%3Fdifficulty%3D3%26page%3D1%26pageSize%3D50%26search%3D%26tab%3D%25E5%2590%258D%25E4%25BC%2581%25E7%25AC%2594%25E8%25AF%2595%25E7%259C%259F%25E9%25A2%2598%26topicId%3D37&difficulty=3&judgeStatus=undefined&tags=&title=
 *
 * @author zhengpei
 * @date 2022/5/3
 */
public class Hwjs59 {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    while (scanner.hasNext()) {
      String i = scanner.next();
      System.out.println(countNum(i));
    }
  }

  private static String countNum(String str) {
    Map<Character, Integer> map = new LinkedHashMap<>();
    for (int i = 0; i < str.length(); i++) {
      if (map.containsKey(str.charAt(i))) {
        map.put(str.charAt(i),map.get(str.charAt(i)) + 1);
      } else {
        map.put(str.charAt(i), 1);
      }
    }
    for(Map.Entry<Character,Integer> entry : map.entrySet()){
      if(entry.getValue() == 1){
        char ch = entry.getKey();
        return String.valueOf(ch);
      }
    }

    return "-1";
  }

}
